import Vue from 'vue'
import App from './App.vue'

import VueRouter from 'vue-router'
Vue.use(VueRouter)

import VueResource from 'vue-resource';
Vue.use(VueResource)

import Login from './components/Login.vue';
import Main from './components/Main.vue';
import Detail from './components/Detail.vue';

const routes = [
  { path: '/login', component: Login},
  { path: '/main', component: Main},
  { path: '/detail/:aid', component: Detail},
  { path: '*', redirect: '/login' }   /*默认跳转路由*/
]

const router = new VueRouter({
  routes // （缩写）相当于 routes: routes
})

new Vue({
  el: '#app',
  router,
  render: h => h(App)
})
